﻿// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. 
// See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics.Contracts;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ActorRuntimeManager
{
    // General-purpose form for conveying status information for long-running operations
    public partial class ModelessStatusForm : Form
    {
        
        public ModelessStatusForm(string operationDescription)
        {
            InitializeComponent();
            this.Text = "Status for " + operationDescription;
        }

        public void Write(string message)
        {
            this.textBoxStatus.AppendText(message);
        }

        public void Write(string format, params object[] args)
        {
            Contract.Requires(format != null);
            Contract.Requires(args != null);

            var s = String.Format(format, args);
            this.textBoxStatus.AppendText(s);
        }

        public void WriteLine(string format, params object[] args)
        {
            Contract.Requires(format != null);
            Contract.Requires(args != null);

            Write(format, args);
            Write("\n");
        }

    }
}
